<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%-- <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %> --%>
<%@ taglib prefix="sitemesh"
	uri="http://www.opensymphony.com/sitemesh/decorator"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="decorator" content="mainframe" />
<title>用户管理</title>
<style>
.test {
	overflow: hidden;
	margin-left: 1.15rem;
	width: 7rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}
</style>
</head>
<body>
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1>
			用户<small>列表显示</small>
		</h1>
		<ol class="breadcrumb">
			<li><a href="#"><i class="fa fa-dashboard"></i>用户信息</a></li>
		</ol>
	</section>
	<!-- Main content -->
	<section class="content">
		<div class="box box-default">
			<div class="box-header">
				<form class="form-horizontal" role="form" id="searchForm" action="<%=request.getContextPath()%>/mgtlog/userinfo">
					<div class="box-tools pull-right" >
						<%-- <div class="input-group input-group-sm" style="width:120px;display:inline-block">
							<input type="text" class="form-control " id="addTime" readonly name="addTimeStart" placeholder="操作时间段(起)"
								value="<fmt:formatDate value='${mgtlog.addTimeStart}' pattern='yyyy-MM-dd'/>"
								onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
						</div>
						<div class="input-group input-group-sm" style="width:10px;display:inline-block;vertical-align: center">
							<span class="form-control" style="padding:5px 0px 5px 0px;border:0px">—</span>
						</div>
						<div class="input-group input-group-sm" style="width:120px;display:inline-block">
							<input type="text" class="form-control input-sm" id="addTime" readonly name="addTimeEnd" placeholder="操作时间段(止)"
									value="<fmt:formatDate value='${mgtlog.addTimeEnd}' pattern='yyyy-MM-dd'/>"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
						</div> --%>
						<div style="display:inline-block"  >
							<div class="input-group input-group-sm" style="width:150px; height:30px;"  >
								<input class="form-control input-sm" type="text" name="loginName" id="loginName" placeholder="用户名(工号)" value="${mgtlog.loginName}"/>
				 					<div class="input-group-btn"  >
			                     	   <button class="btn btn-sm btn-default" onclick="javascript:submitSearch();"><i class="fa fa-search"></i></button>
			                    	</div>
							</div>
						</div>
					</div>
						<input type="hidden" name="pageNumber" id="pageNumber" <%-- value="${pager.pageNumber }" --%>/>
						<input type="hidden" name="pageSize" <%-- value="${pager.pageSize }" --%>/>
					<div class="box-tools"></div>
				</form>
			</div>
			<div class="box-body">
				<table id="example" class="table table-striped table-bordered"
					cellspacing="0" width="100%">
					<!--<caption>基本的表格布局</caption>  -->
					<thead>
						<tr>
							<th>id</th>
							<th>姓名</th>
							<th>性别</th>
							<th>年龄</th>
							<th>手机号</th>
							<th>邮箱</th>
							<th>注册时间</th>
							<th>最后登录时间</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td><a href="javascript:void(0)" onclick='showUserDetail(this);' style="cursor: pointer;">1</a>
							</td>
							<td>A</td>
							<td>男</td>
							<td>23</td>
							<td>18612254354</td>
							<td>cy_wjc@163.com</td>
							<td>2016-05-31</td>
							<td>2016-05-31 10:10:00</td>
						</tr>
						<tr>
							<td><a href="javascript:void(0)" onclick='showUserDetail(this);' style="cursor: pointer;">2</a>
							</td>
							<td>B</td>
							<td>男</td>
							<td>24</td>
							<td>18523254354</td>
							<td>cy_wjc@163.com</td>
							<td>2016-05-31</td>
							<td>2016-05-31 10:10:00</td>
						</tr>
						<tr>
							<td><a href="javascript:void(0)" onclick='showUserDetail(this);' style="cursor: pointer;">3</a>
							</td>
							<td>C</td>
							<td>男</td>
							<td>25</td>
							<td>18523212354</td>
							<td>cy_cac@163.com</td>
							<td>2016-05-31</td>
							<td>2016-05-31 10:10:00</td>
						</tr>
						<tr>
							<td><a href="javascript:void(0)" onclick='showUserDetail(this);' style="cursor: pointer;">4</a>
							</td>
							<td>D</td>
							<td>男</td>
							<td>22</td>
							<td>18523228754</td>
							<td>cy_asd@163.com</td>
							<td>2016-05-31</td>
							<td>2016-05-31 10:10:00</td>
						</tr>
						<tr>
							<td><a href="javascript:void(0)" onclick='showUserDetail(this);' style="cursor: pointer;">5</a>
							</td>
							<td>E</td>
							<td>男</td>
							<td>26</td>
							<td>18523241226</td>
							<td>cy_qwe@163.com</td>
							<td>2016-05-31</td>
							<td>2016-05-31 10:10:00</td>
						</tr>
						<%-- <c:forEach var="mgtuser" items="${pager.datas}" varStatus="status">
							<tr>
								<td hidden="true">
								 	<input type="hidden" value="${mgtuser.userId}" id="userId" name="userId" />
								</td>
								<td>${mgtuser.loginName}</td>
								<td>${mgtuser.nickName}</td>
								<td><fmt:formatDate value="${mgtuser.lastLogin}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
								<td>${mgtuser.ipAddr}</td>
								<td>
									<a href="javascript:void(0)" onclick='showLogDetail(this);' style="cursor: pointer;">查看详情</a>
								</td>
							</tr>
						</c:forEach> --%>
					</tbody>
				</table>
				<nav id="pager"></nav>
			</div>
		</div>
	</section>
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/plugins/jquery/pager/jquery.pager.bootstrap.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/plugins/jquery/pager/pager.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/plugins/datepicker/WdatePicker.js"></script>
	<script>
		var path = "<%=request.getContextPath()%>";
		
		$(document).ready(function() {
			var totalPages = ${pager.totalPages};	
			var pageNumber = ${pager.pageNumber};	
			var pageSize = ${pager.pageSize};
			initPager("pager", pageNumber, totalPages, function(pageclickednumber){
				$("#pageNumber").val(pageclickednumber);
	 			$("#searchForm").submit();
			}, {});
		})
	
		function submitSearch(){
				$("#pageNumber").val(1);
				$("#searchForm").submit();
	 	 }
		
		function showUserDetail(nowTr){
// 			var userId= $(nowTr).parent().parent().find("input[name=userId]").val();
			window.location.href=path + "/mgtuser/userDetails.html?userId=1";
		}
 		
	</script>
</body>
</html>